<template>
	<view class="container">
		<view class="tui-addr-box">
			<form :report-submit="true">
				<view class="tui-list-name">设置超级管理员资料</view>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">超级管理员类型</view>
						<input placeholder-class="tui-phcolor" class="tui-input" value="经营者/法人" disabled maxlength="50" type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">超级管理员姓名</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="contact_name" placeholder="请输入超级管理员姓名" maxlength="50" type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">联系手机</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="mobile_phone" placeholder="请输入联系手机" maxlength="11" type="number" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">联系邮箱</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="contact_email" placeholder="请输入联系邮箱" maxlength="50" type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">超级管理员身份证件号码</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="contact_id_number" placeholder="超级管理员身份证件号码" maxlength="18" type="text" />
					</view>
				</tui-list-cell>
				
                <tui-list-cell :hover="false" padding="0">
                	<view class="tui-line-cell fin-list">
                		<view class="tui-title">超级管理员证件正面照片</view>
                		<view class="fin_img" @tap="chooseImages(0)" v-if="imgarr[0]['name']==''">
                			<view class="icon_cam">
                				<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
                			</view>
                		
                			<view class="fin_txt">上传照片</view>
                		</view>
                		<view class="fin_img" v-else>
                			<image class="uni-uploader__img" :src="imgarr[0]['name']"
                				:data-src="imgarr[0]['name']" @tap="chooseImages(0)"></image>
                		</view>
                	</view>
                </tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">超级管理员证件反面照片</view>
						<view class="fin_img" @tap="chooseImages(1)" v-if="imgarr[1]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[1]['name']"
								:data-src="imgarr[1]['name']" @tap="chooseImages(1)"></image>
						</view>
					</view>
				</tui-list-cell>
				
				
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">超级管理员证件有效期开始时间</view>
						<input placeholder-class="tui-phcolor" @click="show(1,1)" class="tui-input" disabled v-model="contact_period_begin" placeholder="超级管理员证件有效期开始时间" maxlength="50" type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">超级管理员证件有效期结束时间</view>
						<input placeholder-class="tui-phcolor" class="tui-input" @click="show(1,2)" disabled v-model="contact_period_end" placeholder="超级管理员证件有效期结束时间" maxlength="18" type="text" />
					</view>
				</tui-list-cell>
				
				<view class="tui-list-name">设置主体资料</view>
				<tui-list-cell :hover="false" padding="0" :arrow="true">
					<view class="tui-line-cell">
						<view class="tui-title">主体类型</view>
						<picker @change="bindPickerChange" :value="subject_type_index" :range="subject_type_array" range-key="name">
							<view class="input-select">{{subject_type_array[subject_type_index].name}}</view>
						</picker>
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">营业执照图片</view>
						<view class="fin_img" @tap="chooseImages(2)" v-if="imgarr[2]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[2]['name']"
								:data-src="imgarr[2]['name']" @tap="chooseImages(2)"></image>
						</view>
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">注册号/统一社会信用代码</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="license_number" placeholder="注册号/统一社会信用代码" maxlength="18"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">商户名称</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="merchant_name" placeholder="请输入商户名称" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">个体户经营者/法人姓名</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="legal_person" placeholder="个体户经营者/法人姓名" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">注册地址</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="license_address" placeholder="请输入营业执照注册地址" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
					
					
							<view class="tui-title">营业执照有效期限开始日期</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="period_begin" @click="show(1,3)" placeholder="营业执照有效期限开始日期" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">营业执照有有效期限结束日期</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="period_end" @click="show(1,4)" placeholder="营业执照有有效期限结束日期" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell>
				<view class="tui-list-name">设置经营者/法人身份证件</view>
			<!-- 	<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">证件持有人类型</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="id_holder_type" placeholder="证件持有人类型" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell> -->
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">身份证人像面照片</view>
						<view class="fin_img" @tap="chooseImages(3)" v-if="imgarr[3]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[3]['name']"
								:data-src="imgarr[3]['name']" @tap="chooseImages(3)"></image>
						</view>
					</view>
					
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">身份证国徽面照片</view>
						<view class="fin_img" @tap="chooseImages(4)" v-if="imgarr[4]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[4]['name']"
								:data-src="imgarr[4]['name']" @tap="chooseImages(4)"></image>
						</view>
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">身份证姓名</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="id_card_name" placeholder="请输入身份证姓名" maxlength="20"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">身份证号码</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="id_card_number" placeholder="请输入身份证号码" maxlength="18"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">身份证居住地址</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="id_card_address" placeholder="请输入身份证居住地址" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">身份证有效期开始时间</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="card_period_begi" @click="show(1,5)"  placeholder="身份证有效期开始时间" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">身份证有效期结束时间</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="card_period_end" @click="show(1,6)" placeholder="身份证有效期结束时间" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell>
				<view class="tui-list-name">设置经营资料</view>
		<!-- 		<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">经营者/法人是否为受益人</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="shop_phone" placeholder="请输入联系方式" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell> -->
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">商户简称</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="merchant_shortname" placeholder="请输入商户简称" maxlength="20"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">客服电话</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="service_phon" placeholder="请输入客服电话" maxlength="20"
						 type="text" />
					</view>
				</tui-list-cell>
				
		<!-- 		<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">经营场景类型</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="shop_phone" placeholder="请输入联系方式" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell> -->
				<view class="tui-list-name">设置线下场所场景参数</view>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">线下场所名称</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="biz_store_name" placeholder="线下场所名称" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<!-- <tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">线下场所省市编码</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="biz_address_code" placeholder="线下场所省市编码" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell> -->
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">线下场所地址</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="biz_store_address" placeholder="线下场所地址" maxlength="200"
						 type="text" />
					</view>
				</tui-list-cell>
				
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">线下场所门头照片</view>
						<view class="fin_img" @tap="chooseImages(5)" v-if="imgarr[5]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[5]['name']"
								:data-src="imgarr[5]['name']" @tap="chooseImages(5)"></image>
						</view>
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell fin-list">
						<view class="tui-title">线下场所内部照片(请上传门店内部环境照片)</view>
						<view class="fin_img" @tap="chooseImages(6)" v-if="imgarr[6]['name']==''">
							<view class="icon_cam">
								<tui-icon name="camera-add" :size="28" color="#ababab"></tui-icon>
							</view>
						
							<view class="fin_txt">上传照片</view>
						</view>
						<view class="fin_img" v-else>
							<image class="uni-uploader__img" :src="imgarr[6]['name']"
								:data-src="imgarr[6]['name']" @tap="chooseImages(6)"></image>
						</view>
					</view>
				</tui-list-cell>
				<view class="tui-list-name">设置结算银行账户</view>
				<!-- <tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">账户类型</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="shop_phone" placeholder="请输入联系方式" maxlength="11"
						 type="text" />
					</view>
				</tui-list-cell> -->
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">开户名称</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="bank_account_type" placeholder="请输入开户名称" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">开户银行</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="account_name" placeholder="请输入开户银行" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">开户银行省市编码</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="account_bank" placeholder="请输入开户银行省市编码" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">开户银行全称</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="bank_name" placeholder="请输入开户银行全称" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<tui-list-cell :hover="false" padding="0">
					<view class="tui-line-cell">
						<view class="tui-title">银行账号</view>
						<input placeholder-class="tui-phcolor" class="tui-input" v-model="account_number" placeholder="请输入银行账号" maxlength="50"
						 type="text" />
					</view>
				</tui-list-cell>
				<view class="ag_title">
					<radio-group @change="change" style="transform:scale(0.7)" color="#e41f19">
					    <radio color="#e41f19"/>
					</radio-group>
					<view>我已阅读并了解</view>
					<view class="agreement" @tap="treaty">【商户申请协议】</view>
				</view>
				
				<!-- 保存地址 -->
				<view class="tui-btn__box">
					<view class="tui-addr-save" v-if="shop_id===''">
						<tui-button shadow type="danger" height="88rpx" shape="circle" v-if="checked" @click="submit" :loading="isloading" :disabled="isdisabled">点击申请</tui-button>
						<tui-button shadow type="black" disabled height="88rpx" shape="circle" v-else>点击申请</tui-button>
					</view>
				</view>
				<view class="tui-btn__box" v-if="shop_id!==''">
					<view class="tui-addr-save">
						<tui-button shadow type="danger" height="88rpx" shape="circle" v-if="checked" @click="submits" :loading="isloading" :disabled="isdisabled">点击修改</tui-button>
						<tui-button shadow type="black" disabled height="88rpx" shape="circle" v-else>点击修改</tui-button>
					</view>
				</view>
			</form>
		</view>
		<tui-datetime ref="dateTime" :type="type" :startYear="startYear" :endYear="endYear" :cancelColor="cancelColor" :color="color"
		 :setDateTime="setDateTime" :unitTop="unitTop" :radius="radius" @confirm="changeTime"></tui-datetime>
	</view>
</template>
<script>
	import {
		pathToBase64,
		base64ToPath
	} from 'image-tools'
export default {
	data() {
		return {
				contact_name: "",
				credit_code: "",
				shop_phone: "",
				city: "",
				district: "",
				address: "",
				zip_code: "",
				shop_photos:'',
				contact_period_begin:'',
				contact_period_end:'',
				
				period_begin:'',
				period_end:'',
				id_card_name:'',
				id_card_number:'',
				id_card_address:'',
				card_period_begin:'',
				card_period_end:'',
				merchant_shortname:'',
				service_phone:'',
				biz_store_name:'',
				biz_address_code:'',
				biz_store_address:'',
				
				checked:false,
				business_license:'',
				startYear: 1980,
				endYear: 2030,
				cancelColor: '#888',
				color: '#5677fc',
				setDateTime: '',
				result: '',
				unitTop: false,
				radius: false,
				subject_type_index:0,
				id_holder_type:'',
			subject_type_array: [{
				name: '个体户',
				value:'SUBJECT_TYPE_INDIVIDUAL'
			}, {
				name: '企业',
				value:'SUBJECT_TYPE_ENTERPRISE'
			}],
			selectIndex:'',
			imgarr: [
				{
					'name':''
				},
				{
					'name':''
				},
				{
					'name':''
				},
				{
					'name':''
				},
				{
					'name':''
				},
				{
					'name':''
				},
				{
					'name':''
				}
			],
			isdisabled:false,
			isloading:false,
			shop_id: "",
		};
	},
	onShow() {
		this.tui.haslogin();
		this.inits()
	},
	created(){
		 this.subject_type='SUBJECT_TYPE_INDIVIDUAL';
	},
	methods: {
		change(e){
			this.value = e.detail.value;
			this.checked=true;
		},
		inits(){
			let token = this.tui.getToken();
			let joiningTrader={
				token: token,
				type:1,
			};
			
			let joingTrade=this.tui.request('shop','post',joiningTrader,1000,1,'','shopApply');
			Promise.resolve(joingTrade).then((value)=>{
			   if(value.code==200){
				this.shop_id = value.data.shop_id;
				this.shop_name = value.data.shop_name;
				this.credit_code = value.data.credit_code;
				this.shop_phone = value.data.shop_phone;
				this.shop_photos = value.data.shop_photos;
				this.business_license = value.data.business_license;
				this.front_id_card = value.data.front_id_card;
				this.back_id_card = value.data.back_id_card;
				uni.showToast({
					title: value.data.note,
					icon:'none',
					duration: 2000
				});
			   }else{
			   	  
			   }
			})
		},
		treaty:function(){
			uni.navigateTo({
				url: '../franchisee/treaty'
			});
		},
		bindPickerChange: function(e) {
			this.subject_type = this.subject_type_array[e.detail.value];
		},
		show: function(type,index) {
			this.cancelColor = '#888';
			this.color = '#5677fc';
			this.setDateTime = '';
			this.startYear = 1930;
			this.endYear = 2060;
			this.unitTop = false;
			this.radius = false;
			this.selectIndex=index
			switch (type) {
				case 1:
					//this.setDateTime = "2019-10-12";
					this.type = 2;
					break;
				case 2:
					//this.setDateTime = "2019-11";
					this.type = 3;
					break;
				default:
					break;
			}
			this.$refs.dateTime.show();
		},
		changeTime: function(e) {
			switch (this.selectIndex) {
				case 1:
					this.contact_period_begin = e.result;
					break;
				case 2:
					this.contact_period_end = e.result;
					break;
				case 3:
					this.period_begin = e.result;
					
					break;
				case 4:
					this.period_end = e.result;
					break;
				case 5:
					this.type = 1;
					this.setDateTime = '2019-09-12 18:01';
					break;
				
				default:
					break;
			}
			console.log(this.contact_period_end)
		},
		chooseImages: async function(e) {
			uni.chooseImage({
				sizeType: ['original', 'compressed'],
				sourceType: ['album', 'camera'],
				count: 1,
				success: (res) => {
					let max_size = 5 * 1024 * 1024;
					if (res.tempFiles[0].type.indexOf("image") < 0) {
						this.tui.toast("请选择图片类型的文件");
						return;
					}
					if (res.tempFiles[0].size >= max_size) {
						this.tui.toast("上传图片不能超过5M");
						return;
					}
			       
					let token = this.tui.getToken();
					let datas = {
						token: token,
						image: res.tempFiles[0].name,
					};
					let uper = this.tui.uploadFile('shop', datas, res.tempFilePaths[0], 'applyFile');
					Promise.resolve(uper).then((value) => {
						if (value.code == 200) {
							this.imgarr[e]['name']=value.data.file_path;
						} else {
							this.tui.toast(value.message);
						}
					})
				},
				fail: (err) => {
					// #ifdef APP-PLUS
					if (err['code'] && err.code !== 0 && this.sourceTypeIndex === 2) {
						this.checkPermission(err.code);
					}
					// #endif
					// #ifdef MP
					// #endif
				}
			})
		},
		submit(){
			this.isloading=true;
			this.isdisabled=true;
			let token = this.tui.getToken();
			let datas={
				token: token,
				contact_type:'LEGAL',
				contact_name:this.contact_name,
				mobile_phone:this.mobile_phone,
				contact_email:this.contact_email,
				contact_id_number:this.contact_id_number,
				contact_id_doc_copy:this.imgarr[0],
				contact_id_doc_copy_back:this.imgarr[1],
				subject_type:this.subject_type,
				license_copy:this.imgarr[2],
				merchant_name:this.merchant_name,
				license_number:this.license_number,
				legal_person:this.legal_person,
				license_address:this.license_address,
				period_begin:this.period_begin,
				period_end:this.period_end,
				id_holder_type:'LEGAL',
				id_card_copy:this.imgarr[3],
				id_card_national:this.imgarr[4],
				id_card_name:this.id_card_name,
				id_card_number:this.id_card_number,
				id_card_address:this.id_card_address,
				card_period_begin:this.card_period_begin,
				card_period_end:this.card_period_end,
				owner:1,
				merchant_shortname:this.merchant_shortname,
				service_phone:this.service_phone,
				sales_scenes_type:'SALES_SCENES_STORE',
				biz_address_code:'520000',
				biz_store_address:this.biz_store_address,
				store_entrance_pic:this.imgarr[5],
				indoor_pic:this.imgarr[6],
				bank_account_type:'BANK_ACCOUNT_TYPE_CORPORATE',
				settlement_id:703,
				
				
				
				
			};
			let franchinese=this.tui.request('shop','post',datas,1000,1,'','applyContractMerchants');
			Promise.resolve(franchinese).then((value)=>{
			   if(value.code==200){
			   	this.tui.toast(value.message);
				uni.navigateTo({
					url: '/pageschild/user/examine'
				});
			   }else{
			   	this.tui.toast(value.message);
				this.isloading=false;
				this.isdisabled=false;
			   }
			})
		},
		
		initlist(){
			let token = this.tui.getToken();
			let joiningTrader={
				token: token,
				type:1,
			};
			
			let joingTrade=this.tui.request('join','post',joiningTrader,1000,1,'','joinTradeDetail');
			Promise.resolve(joingTrade).then((value)=>{
			   if(value.code==200){
				this.joingTrade=value.data;
				if(this.joingTrade.state==0){
					setTimeout(()=>{
					     this.cg=true
					},3000)
				}
			   }else{
			   	
			   }
			})
		},
	},
};
</script>

<style>
page {
	background-color: #f7f7f7;
}

.container {
	padding-bottom: 100rpx;
	margin-top:20rpx;
	color: #333;
}
.tui-line-cell {
		width: 100%;
		padding: 24rpx 30rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}

	.tui-title {
		width: 240rpx;
		font-size: 28rpx;
	}

	.tui-title-city-text {
		width: 180rpx;
		height: 40rpx;
		display: block;
		line-height: 46rpx;
	}
	
	.ag_title{margin:40rpx 40rpx 0 30rpx;display: flex;box-sizing: border-box;
		display: flex;
		align-items: center;font-size: 20rpx;}
    .uni-uploader__img{width:100%;height:100%;}
	.tui-input {
		width: 500rpx;
		font-size: 28rpx;
	}
	.agreement{color:#ff241d}
	.tui-list-name{
		margin:20rpx 0;
		color:#fff;
		font-weight: bold;
		text-align: center;
		background:#a7a79c;
		/* border-radius: 10rpx; */
		padding:20rpx;
	}
.tui-btn__box{
    width: 100%;
    padding: 20px 15px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
	.tui-input-city {
		flex: 1;
		height: 40rpx;
		font-size: 28rpx;
		padding-right: 30rpx;
	}
     .fin-list{
		 justify-content: space-between;
	 }
	 .fin_img{
	 	border:1px dashed #d9d8d8;
		border-radius: 10rpx;
	 	width:146rpx;
	 	height: 146rpx;
	 	margin:1rpx 0;
	 }
	 .icon_cam{display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 22rpx;}
		.fin_txt{
			font-size: 20rpx;text-align: center;color:#707070
		}
	.tui-phcolor {
		color: #ccc;
		font-size: 28rpx;
	}
	.tui-cell-title{
		font-size: 28rpx;
	}
	.tui-addr-label {
		margin-left: 70rpx;
	}

	.tui-label-item {
		width: 76rpx;
		height: 40rpx;
		border: 1rpx solid rgb(136, 136, 136);
		border-radius: 6rpx;
		font-size: 26rpx;
		text-align: center;
		line-height: 40rpx;
		margin-right: 20rpx;
		display: inline-block;
		transform: scale(0.9);
	}
	.tui-label-active{
		background: #E41F19;
		border-color:#E41F19;
		color: #fff;
	}
	.tui-swipe-cell {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #fff;
		padding: 10rpx 24rpx;
		box-sizing: border-box;
		border-radius: 6rpx;
		overflow: hidden;
		font-size: 28rpx;
	}

	.tui-switch-small {
		transform: scale(0.8);
		transform-origin: 100% center;
	}
</style>
